/*成员变量默认初始化和赋值初始化以及构造函数调用的顺序问题 */
class Glyph {
    void draw() {
        System.out.println("父类Glyph.draw(");
    }

    Glyph() {
        System.out.println("Glyph() before draw()");
        draw();
        System.out.println("Glyph() after draw()");
    }
}

class RoundGlyph extends Glyph {
    int radius = 1;
    RoundGlyph(int r) {
        System.out.println("RoundGlyph构造函数中赋值前 radius = " + radius);
        radius = r;
        System.out.println("RoundGlyph构造函数中赋值后, radius = " + radius);
    }

    void draw() {
        System.out.println("子类RoundGlyph.draw(), radius = " + radius);
    }
}

public class P4_PolyConstructors {
    public static void main(String[] args) {
        new RoundGlyph(5);
    }
}
